home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / doc / cntour05 < prev    next >
Text File  |  1997-07-08  |  1KB  |  44 lines

  1. ; This batch file creates a contour plot that is sized to match
  2. ; the image data. This example is from Chapter 11, "Plotting
  3. ; Multi-dimensional Arrays", of _Using IDL_.
  4.  
  5. ; Restore variables elev, X, and Y.
  6.  
  7. @cntour01
  8.  
  9. ; Set missing data points to a large value.
  10.  
  11. elev(WHERE(elev EQ 0)) = 1E6    
  12.  
  13. ; REBIN down to a 72 x 92 matrix.
  14.  
  15. new = REBIN(elev, 360/5, 460/5)    
  16.  
  17. ; Scale image intensities.
  18.  
  19. image = BYTSCL(elev, MIN=2658, MAX=4241)    
  20.  
  21. ;Get size of plot window in device pixels.
  22.  
  23. PX = !X.WINDOW * !D.X_VSIZE    
  24. PY = !Y.WINDOW * !D.Y_VSIZE
  25.  
  26. ; Get the size of the image.
  27.  
  28. SZ = SIZE(image)
  29.  
  30. ; Display the image with its lower-left corner at the origin of the plot 
  31. ; window.
  32.  
  33. TVSCL, image, PX(0), PY(0)
  34.  
  35. ; Write the contours over the image, being sure to use the exact axis 
  36. ; styles so that the contours fill the plot window. Inhibit erasing.
  37.  
  38. CONTOUR, new, X, Y, XSTYLE = 1, YSTYLE = 1, $
  39.     POSITION = [PX(0), PY(0), PX(0) + SZ(1) - 1, PY(0) + SZ(2) - 1], $
  40.     LEVELS = 2750 + FINDGEN(6) * 250., $ MAX_VALUE = 5000, $
  41.     TITLE='Maroon Bells Region', SUBTITLE = '250 meter contours', $
  42.     XTITLE = 'UTM Coordinates (KM)', /NOERASE, /DEVICE
  43.  
  44.